package com.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.DAO.NoticeDAO;
import com.beans.NoticeForm;

public class MyPostAction extends Action{
	
		@Override
		public ActionForward execute(ActionMapping mapping, ActionForm form,
				HttpServletRequest request, HttpServletResponse response)
				throws Exception {
			
			HttpSession session=request.getSession();
			
			String user_id=session.getAttribute("userid").toString();
			
			NoticeDAO noticeDAO=new NoticeDAO();
			
			ArrayList<NoticeForm> noticelist=noticeDAO.getNoticeByUser(user_id);
			
			System.out.println("Notices are...."+noticelist.size());
					
			//request.setAttribute("noticelist",notice);
			return mapping.findForward("success");
		}

}
